package com.hongmeng.common.constant;

import java.util.regex.Pattern;

/**
 * 通用常量信息
 *
 * @author hongmeng
 */
public class Constants {
    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 默认密码
     */
    public static final String DEFAULT_PASS_WORD = "000000";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_TOKEN_KEY = "login_tokens:";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 2;

    /**
     * 令牌
     */
    public static final String TOKEN = "token";

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";

    /**
     * 令牌前缀
     */
    public static final String LOGIN_USER_KEY = "login_user_key";

    /**
     * 用户ID
     */
    public static final String JWT_USERID = "userid";

    /**
     * 用户名称
     */
    public static final String JWT_USERNAME = "sub";

    /**
     * 用户头像
     */
    public static final String JWT_AVATAR = "avatar";

    /**
     * 创建时间
     */
    public static final String JWT_CREATED = "created";

    /**
     * 用户权限
     */
    public static final String JWT_AUTHORITIES = "authorities";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    /**
     * 资源映射路径 前缀
     */
    public static final String RESOURCE_PREFIX = "/profile";

    /**
     * 是否
     */
    public static class YES_OR_NO{
        public static final Integer YES = 1;
        public static final Integer NO = 0;
    }

    /**
     * 用户帐号状态（0正常 1停用）
     */
    public static class USER_STATE{
        public static final String NORMAL="0";
        public static final String STOP="1";
    }

    /**
     * 用户类型
     */
    public static class USER_TYPE{
        public static final String USER_TYPE = "user_type";
        //系统用户
        public static final String SYS = "00";
        //企业
        public static final String CUSTOMER = "01";
        //医生经纪人
        public static final String DOCTOR_AGENT = "02";
        //医生
        public static final String DOCTOR = "03";
        //患者
        public static final String SICK_PEOPLE = "04";
    }

    /**
     * 文件单位File Unit
     */
    public static class FILE_UNIT{
        public static final String BYTE = "Byte";
        public static final String KB = "KB";
        public static final String MB = "MB";
        public static final String GB = "GB";
    }

    /**
     * 判断字符串是否包含中文
     */
    public static final Pattern CHECK_CHINESE = Pattern.compile("[\u4e00-\u9fa5]");

    public static class GET_NEWS_TYPE{
        /**
         * 上一篇
         */
        public static final String UP="up";
        /**
         * 下一篇
         */
        public static final String NEXT="next";
    }

    /**
     * 文章和视频的审核状态
     */
    public static class NEWS_AND_VIDEO_STATE {
        /**
         * 定时提交，待审核
         */
        public static final String TIMING_SUBMIT = "0";
        /**
         * 已提交，待审核
         */
        public static final String SUBMIT = "1";
        /**
         * 未通过，待修改
         */
        public static final String NOT_PASS = "2";
        /**
         *
         * 已通过，已发布
         */
        public static final String PASS_AND_RELEASE = "3";
    }

    /**
     * 视频使用情况
     */
    public static class VIDEO_USE_TYPE{
        /**
         * 未使用
         */
        public static final String NOT_USE="0";
        /**
         * 已使用
         */
        public static final String IS_USE="1";
    }

    /**
     * 视频格式
     */
    public static class VIDEO_FORMAT{

        public static final String MP4 = "mp4";
    }

    /**
     * 角色权限key
     */
    public class ROLE_KEY{

        /**
         * 运营管理
         */
        public static final String OP_ADMIN = "opAdmin";

        /**
         * 超级管理员
         */
        public static final String ADMIN = "admin";

        /**
         * 企业用户
         */
        public static final String CUSTOMER = "customer";

        /**
         * 医生经纪人用户
         */
        public static final String DOCTOR_AGENT = "doctorAgent";
    }

    /**
     * 官网字典类型
     */
    public static final String OWC = "official_website_configure";
}
